package thread;

public class ThreadA {
	public static void main(String[] args) {
		ThreadB b = new ThreadB(false);
		b.start();
		try {
			Thread.sleep(100);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		synchronized (b) {
			while(!b.flag){
				try {
					b.wait();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			System.out.println("b对象计算的总和是："+b.total);
			b.flag = false;
			b.notify();
		}
	}
}
